package cn.edu.xmu.oomall.customer.dao.openfegin;


import cn.edu.xmu.javaee.core.model.InternalReturnObject;
import cn.edu.xmu.javaee.core.model.ReturnNo;
import cn.edu.xmu.oomall.customer.dao.bo.Region;
import cn.edu.xmu.oomall.customer.mapper.openfegin.RegionMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

@Repository
@RequiredArgsConstructor
public class RegionDao {

    private final RegionMapper regionMapper;

    private Region build(Region bo) {
        return bo;
    }

    public Region findById(Long id) {
//        InternalReturnObject<Region> ret = regionMapper.findRegionById(id);
        InternalReturnObject<Region> ret = new InternalReturnObject<>();
        ret.setErrno(ReturnNo.OK.getErrNo());
        Region region = new Region();
        region.setId(10L);
        region.setName("黄图岗社区居委会");
        ret.setData(region);
        return this.build(ret.getData());
    }

}
